package com.lcxw.hxzbadmin.controller.unioncontroller;

import com.lcxw.hxzbadmin.entity.requestbean.DealUnionIncomeReq;
import com.lcxw.hxzbadmin.entity.requestbean.GetUnionIncomeListReq;
import com.lcxw.hxzbadmin.entity.requestbean.RequestBodyBasic;
import com.lcxw.hxzbapi.entity.response.Response;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/union/income")
public class UnionIncomeController {

    @Resource
    UnionIncomeRealization unionIncomeRealization;

    @PostMapping("/getTerms")
    public Response getUnionIncomeTerms(@RequestBody RequestBodyBasic requestBody) {
        return Response.ok(unionIncomeRealization.getTerms());
    }

    @PostMapping("/getList")
    public Response getUnionIncomeList(
        @RequestBody GetUnionIncomeListReq getUnionIncomeListReq) {
        return unionIncomeRealization.getUnionIncomeList(getUnionIncomeListReq);
    }

    @PostMapping("/deal")
    public Response dealUnionIncome(@RequestBody DealUnionIncomeReq dealUnionIncomeReq) {
        return unionIncomeRealization.dealUnionIncome(dealUnionIncomeReq);
    }

}
